function checkemail(){
	var aemail=document.getElementById("email");
			var reg = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
			if(!(reg.test(aemail)))
				return false;
			else return true;

}
function checkPhone(){ 
    var phone = document.getElementById('phone').value;
    if(!(/^1[3456789]d{9}$/.test(phone)))
        return false; 
    }
	else return true;
}
function checkpassword()
{
	let pa=document.getElementById("password").value;
	let pb=document.getElementById("r_password").value;
	if(pa!=pb)
	return false;
	else return true;
}
function checkall()
{
	let a=checkPhone();
	let b=checkemail();
	let c=checkpassword();
	let string=new String;
	let checkvalue=a*c;
	alert(checkvalue);
	if(checkvalue)
	alert("注册成功")
	else
	{
		if(!a)
		string+="手机号格式错误";
		 if(!b)
		 string+="电子邮箱格式错误";
		if(!c)
		string+="两次密码不相同";
	}
}